package com.test.p18observer.example01;

import java.util.Observable;

/**
 * 目标对象
 */
public class ConcreteSubject extends Observable {

    private int state;


    public void set(int s){
        //目标状态的状态发生了改变
        state = s;

        setChanged();
        notifyObservers(state);
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }
}
